// 根据角色动态生成路由
import { MockMethod } from "vite-plugin-mock";

// http://mockjs.com/examples.html#Object
const systemRouter = {
  path: "/system",
  name: "system",
  redirect: "/system/user",
  meta: {
    icon: "el-icon-setting",
    title: "message.hssysManagement",
    showLink: true,
    savedPosition: true,
    rank: 6
  },
  children: [
    {
      path: "/system/user",
      name: "user",
      meta: {
        title: "message.hsBaseinfo",
        showLink: true,
        savedPosition: true
      }
    },
    {
      path: "/system/dict",
      name: "dict",
      meta: {
        title: "message.hsDict",
        showLink: true,
        savedPosition: true
      }
    }
  ]
};

// const routes = [
//   {
//     id: 8,
//     menuCode: "work",
//     menuName: "工作台",
//     menuUrl: "",
//     menuPath: "/work",
//     parentId: 0,
//     icon: "el-icon-message-solid",
//     menuOrder: 2,
//     isLeaf: "",
//     isDisplay: "Y",
//     resourceList: null,
//     children: [
//       {
//         id: 9,
//         menuCode: "workDashboard",
//         menuName: "工作台",
//         menuUrl: "",
//         menuPath: "/work/dashboard",
//         parentId: 8,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 10,
//         menuCode: "workApproval",
//         menuName: "审批中心",
//         menuUrl: "",
//         menuPath: "/work/approval",
//         parentId: 8,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         resourceList: null,
//         children: []
//       }
//     ]
//   },
//   {
//     id: 11,
//     menuCode: "process",
//     menuName: "进度管理",
//     menuUrl: "",
//     menuPath: "/process",
//     parentId: 0,
//     icon: "el-icon-news",
//     menuOrder: 3,
//     isLeaf: "",
//     isDisplay: "Y",
//     resourceList: null,
//     children: [
//       {
//         id: 12,
//         menuCode: "processMain",
//         menuName: "主计划管理",
//         menuUrl: "",
//         menuPath: "/process/main",
//         parentId: 11,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 13,
//         menuCode: "processMainDetail",
//         menuName: "主计划详情",
//         menuUrl: "",
//         menuPath: "/process/main/detail",
//         parentId: 11,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "N",
//         resourceList: null,
//         children: []
//       }
//     ]
//   },
//   {
//     id: 12,
//     menuCode: "change",
//     menuName: "变更管理",
//     menuUrl: "",
//     menuPath: "/change",
//     parentId: 0,
//     icon: "el-icon-news",
//     menuOrder: 3,
//     isLeaf: "",
//     isDisplay: "Y",
//     resourceList: null,
//     children: [
//       {
//         id: 14,
//         menuCode: "changeManage",
//         menuName: "变更管理",
//         menuUrl: "",
//         menuPath: "/change/manage",
//         parentId: 11,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 15,
//         menuCode: "changeManageDetail",
//         menuName: "主计划详情",
//         menuUrl: "",
//         menuPath: "/change/manage/detail",
//         parentId: 11,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "N",
//         resourceList: null,
//         children: []
//       }
//     ]
//   },
//   {
//     id: 18,
//     menuCode: "document",
//     menuName: "文档管理",
//     menuUrl: "",
//     menuPath: "/document",
//     parentId: 0,
//     icon: "el-icon-news",
//     menuOrder: 3,
//     isLeaf: "",
//     isDisplay: "Y",
//     resourceList: null,
//     children: [
//       {
//         id: 19,
//         menuCode: "documentManage",
//         menuName: "文档管理",
//         menuUrl: "",
//         menuPath: "/document/manage",
//         parentId: 11,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 20,
//         menuCode: "documentManageDetail",
//         menuName: "文档管理详情",
//         menuUrl: "",
//         menuPath: "/document/manage/detail",
//         parentId: 11,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "N",
//         resourceList: null,
//         children: []
//       }
//     ]
//   },
//   {
//     id: 14,
//     menuCode: "project",
//     menuName: "项目管理",
//     menuUrl: "",
//     menuPath: "/project",
//     parentId: 0,
//     icon: "el-icon-menu",
//     menuOrder: 4,
//     isLeaf: "",
//     isDisplay: "Y",
//     resourceList: null,
//     children: [
//       {
//         id: 15,
//         menuCode: "projectManage",
//         menuName: "项目管理",
//         menuUrl: "",
//         menuPath: "/project/manage",
//         parentId: 14,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 16,
//         menuCode: "projectKanban",
//         menuName: "项目看板",
//         menuUrl: "",
//         menuPath: "/project/kanban",
//         parentId: 14,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 17,
//         menuCode: "projectManageDetail",
//         menuName: "项目详情",
//         menuUrl: "",
//         menuPath: "/project/manage/detail",
//         parentId: 14,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "N",
//         resourceList: null,
//         children: []
//       }
//     ]
//   },
//   {
//     id: 18,
//     menuCode: "acceptance",
//     menuName: "验收管理",
//     menuUrl: "",
//     menuPath: "/acceptance",
//     parentId: 0,
//     icon: "el-icon-s-help",
//     menuOrder: 5,
//     isLeaf: "",
//     isDisplay: "Y",
//     sysType: "1",
//     resourceList: null,
//     children: [
//       {
//         id: 20,
//         menuCode: "acceptanceConcealed",
//         menuName: "隐蔽验收",
//         menuUrl: "",
//         menuPath: "/acceptance/concealed",
//         parentId: 18,
//         icon: "",
//         menuOrder: 2,
//         isLeaf: "",
//         isDisplay: "Y",
//         sysType: "1",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 19,
//         menuCode: "acceptanceArrival",
//         menuName: "到货验收",
//         menuUrl: "",
//         menuPath: "/acceptance/arrival",
//         parentId: 18,
//         icon: "",
//         menuOrder: 2,
//         isLeaf: "",
//         isDisplay: "Y",
//         sysType: "1",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 36,
//         menuCode: "acceptanceCompletedDetail",
//         menuName: "土建竣工详情",
//         menuUrl: "",
//         menuPath: "/acceptance/completed/detail",
//         parentId: 18,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "N",
//         sysType: "1",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 35,
//         menuCode: "acceptanceMaterialDetail",
//         menuName: "开工验收详情",
//         menuUrl: "",
//         menuPath: "/acceptance/material/detail",
//         parentId: 18,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "N",
//         sysType: "1",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 34,
//         menuCode: "acceptanceConcealedDetail",
//         menuName: "隐蔽验收详情",
//         menuUrl: "",
//         menuPath: "/acceptance/concealed/detail",
//         parentId: 18,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "N",
//         sysType: "1",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 23,
//         menuCode: "acceptanceArrivalDetail",
//         menuName: "到货验收详情",
//         menuUrl: "",
//         menuPath: "/acceptance/arrival/detail",
//         parentId: 18,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "N",
//         sysType: "1",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 22,
//         menuCode: "acceptanceCompleted",
//         menuName: "土建竣工验收",
//         menuUrl: "",
//         menuPath: "/acceptance/completed",
//         parentId: 18,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         sysType: "1",
//         resourceList: null,
//         children: []
//       },
//       {
//         id: 21,
//         menuCode: "acceptanceMaterial",
//         menuName: "开工验收",
//         menuUrl: "",
//         menuPath: "/acceptance/material",
//         parentId: 18,
//         icon: "",
//         menuOrder: 1,
//         isLeaf: "",
//         isDisplay: "Y",
//         sysType: "1",
//         resourceList: null,
//         children: []
//       }
//     ]
//   }
// ];

const testRouter = [
  {
    id: 1,
    menuCode: "projects",
    menuName: "项目",
    menuUrl: "",
    menuPath: "/projects",
    parentId: 0,
    icon: "el-icon-menu",
    menuOrder: 1,
    isLeaf: "",
    isDisplay: "Y",
    resourceList: null,
    children: [
      {
        id: 1,
        menuCode: "projectsManage",
        menuName: "项目管理",
        menuUrl: "",
        menuPath: "/projects",
        parentId: 0,
        icon: "el-icon-menu",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: [
          {
            id: 39,
            menuCode: "projectsSpace",
            menuName: "项目空间",
            menuUrl: "",
            menuPath: "/projects/manage/space",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          },
          {
            id: 222,
            menuCode: "projectsAddProject",
            menuName: "新增项目",
            menuUrl: "",
            menuPath: "/projects/manage/space/add",
            parentId: 1212,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            resourceList: null,
            children: []
          },
          {
            id: 40,
            menuCode: "projectsChange",
            menuName: "变更管理",
            menuUrl: "",
            menuPath: "/projects/manage/change",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 2,
        menuCode: "projectsStandard",
        menuName: "标准管理",
        menuUrl: "",
        menuPath: "/projects/standard",
        parentId: 0,
        icon: "el-icon-menu",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: [
          {
            id: 39,
            menuCode: "projectsQuality",
            menuName: "质量标准",
            menuUrl: "",
            menuPath: "/projects/standard/quality",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 3,
        menuCode: "projectsTemplate",
        menuName: "模板管理",
        menuUrl: "",
        menuPath: "/projects/template",
        parentId: 0,
        icon: "el-icon-menu",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: [
          {
            id: 39,
            menuCode: "projectsTemplateProject",
            menuName: "项目模板",
            menuUrl: "",
            menuPath: "/projects/template/project",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 4,
        menuCode: "projectsBidding",
        menuName: "招投标管理",
        menuUrl: "",
        menuPath: "/projects/bidding",
        parentId: 0,
        icon: "el-icon-menu",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: [
          {
            id: 39,
            menuCode: "projectsBiddingIndex",
            menuName: "招投标管理",
            menuUrl: "",
            menuPath: "/projects/bidding/index",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          }
        ]
      }
    ]
  },
  {
    id: 2,
    menuCode: "approval",
    menuName: "审批",
    menuUrl: "",
    menuPath: "/approval",
    parentId: -1,
    icon: "el-icon-message-solid",
    menuOrder: 1,
    isLeaf: "",
    isDisplay: "Y",
    resourceList: null,
    children: [
      {
        id: 0,
        menuCode: "approval",
        menuName: "我的审批",
        menuUrl: "",
        menuPath: "/approval",
        parentId: -1,
        icon: "el-icon-message-solid",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: [
          {
            id: 39,
            menuCode: "approvalTodo",
            menuName: "待办",
            menuUrl: "",
            menuPath: "/approval/todo",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          },
          {
            id: 391,
            menuCode: "approvalDetail",
            menuName: "审批详情",
            menuUrl: "",
            menuPath: "/approval/detail",
            parentId: 39,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            resourceList: null,
            children: []
          },
          {
            id: 40,
            menuCode: "approvalDone",
            menuName: "已办",
            menuUrl: "",
            menuPath: "/approval/done",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          },
          {
            id: 41,
            menuCode: "approvalSelf",
            menuName: "我发起的",
            menuUrl: "",
            menuPath: "/approval/self",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          },
          {
            id: 42,
            menuCode: "approvalAll",
            menuName: "所有审批",
            menuUrl: "",
            menuPath: "/approval/all",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          }
        ]
      }
    ]
  },
  {
    id: 24,
    menuCode: "system",
    menuName: "系统",
    menuUrl: "",
    menuPath: "/system",
    parentId: 0,
    icon: "el-icon-folder",
    menuOrder: 6,
    isLeaf: "",
    isDisplay: "Y",
    resourceList: null,
    children: [
      {
        id: 24,
        menuCode: "system",
        menuName: "系统管理",
        menuUrl: "",
        menuPath: "/system",
        parentId: 0,
        icon: "el-icon-setting",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        sysType: "1",
        resourceList: null,
        children: [
          {
            id: 28,
            menuCode: "systemOrganization",
            menuName: "公司管理",
            menuUrl: "",
            menuPath: "/system/organization",
            parentId: 24,
            icon: "",
            menuOrder: 5,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 27,
            menuCode: "systemManage",
            menuName: "用户管理",
            menuUrl: "",
            menuPath: "/system/manage",
            parentId: 24,
            icon: "",
            menuOrder: 4,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 25,
            menuCode: "systemRole",
            menuName: "角色管理",
            menuUrl: "",
            menuPath: "/system/role",
            parentId: 24,
            icon: "",
            menuOrder: 3,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 26,
            menuCode: "systemMenu",
            menuName: "菜单管理",
            menuUrl: "",
            menuPath: "/system/menu",
            parentId: 24,
            icon: "",
            menuOrder: 2,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 134,
            menuCode: "systemAnalysis",
            menuName: "系统分析",
            menuUrl: "",
            menuPath: "/system/analysis",
            parentId: 24,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 54,
            menuCode: "systemLog",
            menuName: "日志管理",
            menuUrl: "",
            menuPath: "/system/log",
            parentId: 24,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 32,
            menuCode: "systemResource",
            menuName: "资源管理",
            menuUrl: "",
            menuPath: "/system/resource",
            parentId: 24,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          }
        ]
      }
    ]
  },
  {
    id: 8,
    menuCode: "projectsA",
    menuName: "A类项目",
    menuUrl: "",
    menuPath: "/projectsA",
    parentId: 0,
    icon: "el-icon-message-solid",
    menuOrder: 2,
    isLeaf: "",
    isDisplay: "N",
    resourceList: null,
    children: [
      {
        id: 16,
        menuCode: "projectsAKanban",
        menuName: "项目看板",
        menuUrl: "",
        menuPath: "/projectsA",
        parentId: 14,
        icon: "el-icon-menu",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: []
      },
      {
        id: 14,
        menuCode: "project",
        menuName: "项目管理",
        menuUrl: "",
        menuPath: "/projectsA/project",
        parentId: 0,
        icon: "el-icon-menu",
        menuOrder: 7,
        isLeaf: "",
        isDisplay: "Y",
        sysType: "1",
        resourceList: null,
        children: [
          {
            id: 15,
            menuCode: "projectManage",
            menuName: "项目管理",
            menuUrl: "",
            menuPath: "/projectsA/project/manage",
            parentId: 14,
            icon: "",
            menuOrder: 2,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 55,
            menuCode: "projectUserlist",
            menuName: "人员列表",
            menuUrl: "",
            menuPath: "/projectsA/project/team",
            parentId: 14,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 16,
            menuCode: "projectKanban",
            menuName: "项目看板",
            menuUrl: "",
            menuPath: "/projectsA/project/kanban",
            parentId: 14,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 8,
        menuCode: "work",
        menuName: "工作台",
        menuUrl: "",
        menuPath: "/projectsA/work",
        parentId: 0,
        icon: "el-icon-message-solid",
        menuOrder: 8,
        isLeaf: "",
        isDisplay: "Y",
        sysType: "1",
        resourceList: null,
        children: [
          {
            id: 9,
            menuCode: "workDashboard",
            menuName: "工作台",
            menuUrl: "",
            menuPath: "/projectsA/work/dashboard",
            parentId: 8,
            icon: "",
            menuOrder: 2,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 33,
            menuCode: "workApproval",
            menuName: "审批中心",
            menuUrl: "",
            menuPath: "/projectsA/work/approval",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 11,
        menuCode: "process",
        menuName: "进度管理",
        menuUrl: "",
        menuPath: "/projectsA/process",
        parentId: 0,
        icon: "el-icon-news",
        menuOrder: 6,
        isLeaf: "",
        isDisplay: "Y",
        sysType: "1",
        resourceList: null,
        children: [
          {
            id: 13,
            menuCode: "processMainDetail",
            menuName: "主计划详情",
            menuUrl: "",
            menuPath: "/projectsA/process/main/detail",
            parentId: 11,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 12,
            menuCode: "processMain",
            menuName: "主计划管理",
            menuUrl: "",
            menuPath: "/projectsA/process/main",
            parentId: 11,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 39,
        menuCode: "quality",
        menuName: "质量管理",
        menuUrl: "",
        menuPath: "/projectsA/quality",
        parentId: 0,
        icon: "el-icon-discover",
        menuOrder: 4,
        isLeaf: "",
        isDisplay: "Y",
        sysType: "1",
        resourceList: null,
        children: [
          {
            id: 41,
            menuCode: "qualityInspectionDetail",
            menuName: "质量检查详情",
            menuUrl: "",
            menuPath: "/projectsA/quality/inspection/detail",
            parentId: 39,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 40,
            menuCode: "qualityInspection",
            menuName: "质量检查",
            menuUrl: "",
            menuPath: "/projectsA/quality/inspection",
            parentId: 39,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 42,
        menuCode: "change",
        menuName: "变更管理",
        menuUrl: "",
        menuPath: "/projectsA/change",
        parentId: 0,
        icon: "el-icon-s-operation",
        menuOrder: 2,
        isLeaf: "",
        isDisplay: "Y",
        sysType: "1",
        resourceList: null,
        children: [
          {
            id: 47,
            menuCode: "changeManageDetail",
            menuName: "变更管理详情",
            menuUrl: "",
            menuPath: "/projectsA/change/manage/detail",
            parentId: 42,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 43,
            menuCode: "changeManage",
            menuName: "变更管理",
            menuUrl: "",
            menuPath: "/projectsA/change/manage",
            parentId: 42,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 44,
        menuCode: "document",
        menuName: "文档管理",
        menuUrl: "",
        menuPath: "/projectsA/document",
        parentId: 0,
        icon: "el-icon-folder-opened",
        menuOrder: 3,
        isLeaf: "",
        isDisplay: "Y",
        sysType: "1",
        resourceList: null,
        children: [
          {
            id: 48,
            menuCode: "documentManageDownload",
            menuName: "文档下载",
            menuUrl: "",
            menuPath: "/projectsA/document/manage/download",
            parentId: 44,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 46,
            menuCode: "documentManage",
            menuName: "文档管理",
            menuUrl: "",
            menuPath: "/projectsA/document/manage",
            parentId: 44,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 45,
            menuCode: "documentManageDetail",
            menuName: "文档管理详情",
            menuUrl: "",
            menuPath: "/projectsA/document/manage/detail",
            parentId: 44,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 18,
        menuCode: "acceptance",
        menuName: "验收管理",
        menuUrl: "",
        menuPath: "/projectsA/acceptance",
        parentId: 0,
        icon: "el-icon-s-help",
        menuOrder: 5,
        isLeaf: "",
        isDisplay: "Y",
        sysType: "1",
        resourceList: null,
        children: [
          {
            id: 20,
            menuCode: "acceptanceConcealed",
            menuName: "隐蔽验收",
            menuUrl: "",
            menuPath: "/projectsA/acceptance/concealed",
            parentId: 18,
            icon: "",
            menuOrder: 2,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 19,
            menuCode: "acceptanceArrival",
            menuName: "到货验收",
            menuUrl: "",
            menuPath: "/projectsA/acceptance/arrival",
            parentId: 18,
            icon: "",
            menuOrder: 2,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 36,
            menuCode: "acceptanceCompletedDetail",
            menuName: "土建竣工详情",
            menuUrl: "",
            menuPath: "/projectsA/acceptance/completed/detail",
            parentId: 18,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 35,
            menuCode: "acceptanceMaterialDetail",
            menuName: "开工验收详情",
            menuUrl: "",
            menuPath: "/projectsA/acceptance/material/detail",
            parentId: 18,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 34,
            menuCode: "acceptanceConcealedDetail",
            menuName: "隐蔽验收详情",
            menuUrl: "",
            menuPath: "/projectsA/acceptance/concealed/detail",
            parentId: 18,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 23,
            menuCode: "acceptanceArrivalDetail",
            menuName: "到货验收详情",
            menuUrl: "",
            menuPath: "/projectsA/acceptance/arrival/detail",
            parentId: 18,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "N",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 22,
            menuCode: "acceptanceCompleted",
            menuName: "土建竣工验收",
            menuUrl: "",
            menuPath: "/projectsA/acceptance/completed",
            parentId: 18,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          },
          {
            id: 21,
            menuCode: "acceptanceMaterial",
            menuName: "开工验收",
            menuUrl: "",
            menuPath: "/projectsA/acceptance/material",
            parentId: 18,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            sysType: "1",
            resourceList: null,
            children: []
          }
        ]
      }
    ]
  },
  {
    id: 90,
    menuCode: "projectsB",
    menuName: "B类项目",
    menuUrl: "",
    menuPath: "/projectsB",
    parentId: 0,
    icon: "el-icon-message-solid",
    menuOrder: 2,
    isLeaf: "",
    isDisplay: "N",
    resourceList: null,
    children: [
      {
        id: 16,
        menuCode: "projectsBKanban",
        menuName: "项目看板",
        menuUrl: "",
        menuPath: "/projectsB",
        parentId: 14,
        icon: "el-icon-menu",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: []
      },
      {
        id: 123,
        menuCode: "projectsBManages",
        menuName: "项目管理",
        menuUrl: "",
        menuPath: "/projectsB/manage",
        parentId: 8,
        icon: "el-icon-message-solid",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: [
          {
            id: 3911,
            menuCode: "projectsBArchives",
            menuName: "项目档案",
            menuUrl: "",
            menuPath: "/projectsB/manage/archives",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          },
          {
            id: 3911,
            menuCode: "projectsBTeam",
            menuName: "项目组管理",
            menuUrl: "",
            menuPath: "/projectsB/manage/team",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 123,
        menuCode: "projectsBLifeCycle",
        menuName: "全生命周期管理",
        menuUrl: "",
        menuPath: "/projectsB/lifeCycle",
        parentId: 8,
        icon: "el-icon-message-solid",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: [
          {
            id: 3911,
            menuCode: "projectsBMatters",
            menuName: "项目事项",
            menuUrl: "",
            menuPath: "/projectsB/lifeCycle/matters",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          }
        ]
      },
      {
        id: 123,
        menuCode: "projectsBDocuments",
        menuName: "文档管理",
        menuUrl: "",
        menuPath: "/projectsB/document",
        parentId: 8,
        icon: "el-icon-message-solid",
        menuOrder: 1,
        isLeaf: "",
        isDisplay: "Y",
        resourceList: null,
        children: [
          {
            id: 3911,
            menuCode: "projectsBDocument",
            menuName: "文档管理",
            menuUrl: "",
            menuPath: "/projectsB/document/manage",
            parentId: 8,
            icon: "",
            menuOrder: 1,
            isLeaf: "",
            isDisplay: "Y",
            resourceList: null,
            children: []
          }
        ]
      }
    ]
  }
];
// const bussinessRouter = {
//   path: "/bussiness",
//   name: "bussiness",
//   redirect: "/bussiness/index",
//   meta: {
//     icon: "el-icon-folder",
//     title: "message.bussinessManagement",
//     showLink: true,
//     savedPosition: true,
//     rank: 6
//   },
//   children: [
//     {
//       path: "/bussiness/index",
//       name: "index",
//       meta: {
//         title: "message.bussinessManagement",
//         showLink: true,
//         savedPosition: true
//       }
//     },
//     {
//       path: "/bussiness/edit",
//       name: "edit",
//       meta: {
//         title: "message.bussinessManagement",
//         showLink: false,
//         savedPosition: false
//       }
//     },
//     {
//       path: "/bussiness/contract",
//       name: "contract",
//       meta: {
//         title: "message.contractManagement",
//         showLink: true,
//         savedPosition: true
//       }
//     }
//   ]
// };

const permissionRouter = {
  path: "/permission",
  name: "permission",
  redirect: "/permission/page",
  meta: {
    title: "message.permission",
    icon: "el-icon-lollipop",
    showLink: true,
    savedPosition: true,
    rank: 3
  },
  children: [
    {
      path: "/permission/page",
      name: "permissionPage",
      meta: {
        title: "message.permissionPage",
        showLink: true,
        savedPosition: true
      }
    },
    {
      path: "/permission/button",
      name: "permissionButton",
      meta: {
        title: "message.permissionButton",
        showLink: true,
        savedPosition: true,
        authority: []
      }
    }
  ]
};

// 添加不同按钮权限到/permission/button页面中
function setDifAuthority(authority, routes) {
  routes.children[1].meta.authority = [authority];
  return routes;
}

export default [
  {
    url: "/getAsyncRoutes",
    method: "get",
    response: () => {
      // if (query.name === "admin") {
      return {
        code: 200,
        data:
          // systemRouter,
          testRouter
        // bussinessRouter,
        // setDifAuthority("v-admin", permissionRouter)
      };
      // } else {
      //   return {
      //     code: 0,
      //     // info: [setDifAuthority("v-test", permissionRouter)]
      //     info: []
      //   };
      // }
    }
  }
] as MockMethod[];
